<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form>
    <table border="1">
        <thead>
        <th>shopcart_id</th>
        <th>product_id</th>
        <th>user_id</th>
        <th>shopcart_num</th>
        <th>shopcart_createtime</th>
        <th>操作</th>
        </thead>
        <tbody>
        <tr th:each="shopcart: ${shopcarts}">
            <td th:text="${shopcart.shopcartId}"></td>
            <td th:text="${shopcart.productId}"></td>
            <td th:text="${shopcart.userId}"></td>
            <td th:text="${shopcart.shopcartNum}"></td>
            <td th:text="${shopcart.shopcartCreatetime}"></td>
            <td>
                <a th:href="'shopcart/delShopcart?shopcartId='+ ${shopcart.shopcartId}">删除</a>
                <a th:href="'shopcart/updateShopcart?shopcartId='+ ${shopcart.shopcartId}">修改</a>
                <a th:href="'shopcart/selectByUid?userId='+ ${shopcart.userId}">查找id</a>
            </td>
        </tr>
        <tr>
            <td >其他：</td>
            <td ><a th:href="'addShopcart?'">购物车数据增加</a> </td>
            <td><label>输入用户id：</label><input id="user_id"><a th:href="'shopcart/selectByUid'+userId"><input type="submit" ></a></td>
        </tr>

        </tbody>
    </table>
</form>
<script>
    var userId = document.getElementById("user_id").value;
</script>
</body>
</html>